<#include
        "../../common/com.html"  /> <@layout>
<!-- ace styles -->
<link rel="stylesheet" href="${ctx}/static/assets/css/ace.min.css" />


<script type="text/javascript">

    function saveModel() {
        if(Validator.Validate(document.getElementById('form1'))){
        } else {
            return;
        }
//       var m=$("#nr").val();
//        m = m.replace(/(\t)/g, "");
//       m = m.replace(/(\n)/g, "");
//        alert(m);
////        $("#xmjj").attr("value",m);
// 同步数据后可以直接取得textarea的value
        var id=document.getElementById("id").value;
        url = '';
        if(id==""){
            url = '${ctx}/cgglWp/savelb';
        }     else{
            url = '${ctx}/cgglWp/updatelb';
        }
        $('#form1').form('submit', {
            url : url,
            onSubmit : function() {
                return $(this).form('validate');
            },
            success : function(data) {
                alert(data);
                parent.parent.location.reload();
            }
        });

    }
</script>
<body>
<div class="page-header"  style="overflow: hidden">

    <div class="row-fluid">
        <div class="span12">
            <!-- PAGE CONTENT BEGINS -->
            <div class="tabbable tabs-left">
                <form class="form-horizontal"  id="form1" method="post" >
                    <table class="table table-condensed table-bordered">
                        <tbody>
                        <tr class="info">
                            <td>
                                上级类别名称：
                            </td>
                            <td >${name}
                                <input type="hidden" name="id" id="id" style="min-height: 24px;" >
                                <input type="hidden" name="sj_lbid" id="sj_lbid" style="min-height: 24px;" value="${lbid}">
                            </td>
                        </tr>
                        <tr class="info">
                            <td>
                                类别编号：
                            </td>
                            <td>
                                <input id="lbbh" name="lbbh" type="text"  style="min-height: 24px;"  dataType="Require" msg="请输入类别编号"  maxlength="20"  />
                            </td>
                        </tr>
                        <tr class="info">
                            <td>
                                类别名称：
                            </td>
                            <td>
                                <input id="lbmc" name="lbmc" type="text"  style="min-height: 24px;"  dataType="Require" msg="请输入类别名称"  maxlength="20"  />
                            </td>
                        </tr>
                        <tr class="info">
                            <td>
                                显示顺序：
                            </td>
                            <td>
                                <input id="dsporder" name="dsporder" type="text" maxlength="3"  class="number" style="min-height: 24px;"  />
                            </td>
                        </tr>
                        <tr class="info">
                            <td>
                                有效标志：
                            </td>
                            <td>
                                <select name="yxbz" id="yxbz">
                                    <option value="1" selected>有效</option>
                                    <option value="0">无效</option>
                                </select>
                            </td>
                        </tr>
                        <tr class="info">
                            <td colspan="4" style="text-align: center">
                                <a href="#"  class="btn btn-info btn-small" onclick="saveModel()"   >确定 </a>
                                &nbsp; &nbsp;&nbsp;&nbsp;
                                <a href="#"  class="btn btn-danger btn-small bigger-110"  onclick="parent.closeDialog();"  >取消 </a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </form>
            </div>

        </div>

    </div>
</div>

</body>


<script>
    <#list list as m>
      document.getElementById("id").value  = '${(m.id)!}';
    document.getElementById("lbmc").value  =  '${(m.lbmc)!}';
    document.getElementById("lbbh").value  =  '${(m.lbbh)!}';
    document.getElementById("sj_lbid").value  =  '${(m.sj_lbid)!}';
    document.getElementById("yxbz").value  =  '${(m.yxbz)!}';
    document.getElementById("dsporder").value  =  '${(m.dsporder)!}';

    </#list>


</script>
</@layout>

